package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.dao.provider.FriendPatientEventProvider;
import com.ajk.server.model.FriendPatientEvent;
import com.ajk.server.model.query.FriendPatientEventQuery;
/**
 * 亲友健康数据  <br>
 * t_friend_patient_event <br>
 * v1.0 2016-05-01
 */
 public interface FriendPatientEventMapper {
 	
 	/**
 	*根据id删除 亲友健康数据
 	*/
 	@Delete("delete from t_friend_patient_event where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 亲友健康数据
 	*/
 	@InsertProvider(method="batchInsert",type=FriendPatientEventProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends FriendPatientEvent> friendPatientEvents);
 	
 	/**
 	* 新增 亲友健康数据
 	*/
 	@InsertProvider(method="insert",type=FriendPatientEventProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(FriendPatientEvent domain);
 
 	
 	/**
 	*更新 亲友健康数据
 	*/
 	@UpdateProvider(method="update",type=FriendPatientEventProvider.class)
 	public Integer update(FriendPatientEvent domain);
 	
 	/**
 	*根据ID查询 亲友健康数据
 	*/
	@Select("select * from t_friend_patient_event where id=#{id}")
	public FriendPatientEvent findById(Integer id);
	
	/**
 	*通过query 查询 亲友健康数据
 	*/
 	@SelectProvider(method="findByQuery",type=FriendPatientEventProvider.class)
 	public List<FriendPatientEvent> findByQuery(FriendPatientEventQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=FriendPatientEventProvider.class)
 	public Integer countByQuery(FriendPatientEventQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=FriendPatientEventProvider.class)
 	public List<FriendPatientEvent> findByIds(List<Integer> ids);
 	
 	
 	@Select("select * from t_friend_patient_event where uuid=#{uuid} and friend_id=#{friendId}")
	public FriendPatientEvent findByUuidAndFriendId(@Param("uuid") String uuid,@Param("friendId") Integer friendId);
 	

}	